package mybox.engine;

public class Line {
	
	public File4Qcad file4qcad=null;
	public QVector begin=null;
	public QVector end=null;//
	
	public Line(File4Qcad file4qcad, QVector begin, QVector end) {
		this.file4qcad=file4qcad;
		this.begin=begin;;
		this.end=end;		
	}
	
	public double length() {
		return QVector.diffEuklid(begin, end);
	}
	
	public void draw() {
		file4qcad.println(QVector.printLine(begin, end));
	}
	
	public static Line xMirror(File4Qcad file4qcad, double xNull, Line line) {
		return new Line(
						file4qcad, 
						new QVector(xNull-line.begin.x, line.begin.y), 
						new QVector(xNull-line.end.x, line.end.y)
					);
	}
	
	public String toString() {
		return "begin="+begin+" end="+end;
	}

}
